// 获取tab栏数据
fetch("http://chst.vip:1234/api/getbaicaijiatitle?")
.then((body)=>body.json())
.then((res)=>{
console.log(res)
let html = "";
let{result:data}=res;
data.forEach((item) => {
    html +=`<li class="${item.titleId}">${item.title}
    </li>` 
});
let va=document.querySelector("#nav ul").innerHTML+=html;


 })

 $('.ul_box').on('click',function(e){
    //  console.log(666688888);
    $(e.target).css('color','red').siblings().css('color','black')
    console.log(e);
    console.log(e.target.className);
    var titleid=e.target.className
    fetch("http://chst.vip:1234/api/getbaicaijiaproduct?titleid="+titleid)
.then((body)=>body.json())
.then((res)=>{
    let htmll = "";
    let {result:data}=res;
    console.log(res);
    data.forEach((item)=>{
        htmll +=`<li>
        <div class="img">${item.productImg}</div>
        <div class="title"><h4>${item.productName}</h4></div>
        <div class="money">${item.productPrice}</div>
        ${item.productCouponRemain}
        ${item.productCoupon}
        <b>${item.productHref}</b>
        </li>`
       
 })
  document.querySelector("#navv ul").innerHTML=htmll;
})

 

})
// 获取分类列表
fetch("http://chst.vip:1234/api/getbaicaijiaproduct?titleid=0")
.then((body)=>body.json())
.then((res)=>{
    let htmll = "";
    let {result:data}=res;
    console.log(res);
    data.forEach((item)=>{
        htmll +=`<li>
        <div class="img">${item.productImg}</div>
        <div class="title"><h4>${item.productName}</h4></div>
        <div class="money">${item.productPrice}</div>
        ${item.productCouponRemain}
        ${item.productCoupon}
        <b>${item.productHref}</b>
        </li>`
       
        
        
    })
  let lis=  document.querySelector("#navv ul").innerHTML+=htmll;
   
  
})

  

// 点击到达相应页面

